/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.depaul.se.courseregistration.webservice;

import edu.depaul.se.courseregistration.jpa.schedule.EnrolledClass;
import edu.depaul.se.courseregistration.sessionbean.StudentSession;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

/**
 *
 * @author lmarco
 */
//@WebService(serviceName = "StudentService")
@Stateless()
public class StudentService {

    @EJB
    private StudentSession studentSession; 
    
    @WebMethod(operationName = "Enroll")
    public int Enroll(@WebParam (name = "sectionId") int sectionId, @WebParam (name = "personId") int personId) {
        return studentSession.EnrollCourse(sectionId, personId);
    }
    
    @WebMethod(operationName = "Drop")
    public int Drop(@WebParam (name = "sectionId") int sectionId, @WebParam (name = "personId") int personId) {
        return studentSession.dropCourse(sectionId, personId);
    }
    
    @WebMethod(operationName = "GetMyClassGrade")
    public String GetMyClassGrade(@WebParam (name = "sectionId") int sectionId, @WebParam (name = "personId") int personId) {
        return studentSession.getClassGradebyStudentId(sectionId, personId);
    }
    
    @WebMethod(operationName = "GetStudentSchedule")
    public List<EnrolledClass> GetStudentSchedule(@WebParam (name = "personId") int personId) {
        return studentSession.getSchedule(personId);
    }
}
